﻿using System;
using System.IO;
using log4net;
using log4net.Config;

namespace CzfSDK
{
	public class CzfLog
	{
		public static event CzfEvent<object, Exception> OnError;

		public static bool showInfo = false;
		public static CzfLog current;

		public static void Info(object msg)
		{
			if(showInfo)
				current.CInfo (msg);
		}
		public static void Error(object msg, Exception e)
		{
			current.CError (msg, e);
			if (OnError != null) {
				OnError (msg, e);
			}
		}


		protected virtual void CInfo(object msg)
		{
			throw new Exception ("不能使用CzfLog实例");
		}

		protected virtual void CError(object msg, Exception e)
		{
			throw new Exception ("不能使用CzfLog实例");
		}
	}
}

